package com.muyu.user.domain.resp;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import com.muyu.user.domain.SysUserFriend;
import com.muyu.user.domain.model.SysUserFriendPageQueryModel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 好友关系分页接口返回结果集
 *
 * @author liuguoqiang
 * @date 2025-09-18
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "好友关系分页接口返回结果集")
public class SysUserFriendPageResp {

    /**
     * 好友ID
     */
    @Schema(name = "friendId", title = "好友ID", description = "好友ID" )
    private Long friendId;

    /**
     * 好友昵称
     */
    @Schema(name = "friendNickname", title = "好友昵称", description = "好友昵称" )
    private String friendNickname;

    /**
     * 好友等级
     */
    @Schema(name = "friendLevel", title = "好友等级", description = "好友等级" )
    private String friendLevel;

    /**
     * 加入时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(name = "joinTime", title = "加入时间", description = "加入时间" )
    private Date joinTime;

    /**
     * 信息构造器
     */
    public static SysUserFriendPageResp infoBuild(SysUserFriendPageQueryModel pageQueryModel){
        return SysUserFriendPageResp.builder()
            .friendId(pageQueryModel.getFriendId())
            .friendNickname(pageQueryModel.getFriendNickname())
            .friendLevel(pageQueryModel.getFriendLevel())
            .joinTime(pageQueryModel.getJoinTime())
            .build();
    }

}
